package utility;

import java.io.FileInputStream;
import java.util.Properties;

public class  Input 
{
	public static String DB_USERNAME;
	public static String DB_PASSWORD;
	public static String DB_PREFIX;
	public static String DB_NAME;
	public static String DB_HOST;
	public static String DB_DRIVER;
		
	public static String TYPE = "9";
	public static String ROOT="//home//wiki//Reports//";
	public static String MASTERREPORTSPATH= ROOT + "Basic_Reports//Master_Reports//";
	public static String TRASACTIONREPORTSPATH=ROOT +"Basic_Reports//Transaction_Reports//";
	public static String BASICREPORTSPATH=ROOT+"Basic_Reports//";
	public static String BASICTRANSDETAILSREPORTPATH = ROOT+"Basic_Reports//Transaction_Reports//Transaction_Details_Reports//";
	public static String CUSTOMREPORTS=ROOT+"Custom_Reports";
	
	public static String PROCESSLOGGERPATH = ROOT+"Logs//ProcessLogger//";
	public static String LogDir = ROOT+"Logs//Logger//";
	public static String STORAGEPATH = ROOT+"Dynamic_";
	public static String BILLREPORT=ROOT+"BillReports//";
	public static String SOBILLREPORT=ROOT+"SO_Bill_";
	public static String SENDMESSAGELOG=ROOT+"Logs//SendMessage//";
	public static String SMSBUFFER = ROOT+"Logs//SMSBuffer//";
	public static String TDPRODETAILSREPORT=ROOT+"Basic_Reports//Transaction_Reports//Transaction_Details_Reports//TD_Property_Details//";
	public static String GROUPREPORT=ROOT+"GroupReport//";
	public static String TRANSPDREPORT=ROOT+"Basic_Reports//Transaction_Reports//Trans_Property_Details//";
	   // public static String	Transaction_Details_Reports=ROOT+"Basic_Transaction_Transaction_Details_";
	public static String SEPARATOR ="\t";
	public static String ENDSEPARATOR="\n";
	
	public static String FILRFORMAT=".txt";
	public static char ch='\t';
	//public static String Bill_Reports = ROOT+"BillReports//";//This line is inserted by Hemant for example
	//public static String webreports = "//home//wiki//apache-tomcat-5.5.25//webapps//ROOT//webreports//";
	public static String LOCATION = "//home//wiki//apache-tomcat-5.5.25//webapps//ROOT//webreports//";
	//public static String Web_Reports = "localhost:8080/webreports/";//This line is inserted by Hemant for example
	public static String URL = "localhost:8080/webreports/";//This line is inserted by Hemant for example
	public static String WEB_REPORTS_FILES = ROOT + "WebReports//WebReportsTextFiles//";
//	public static char ch = '\t';
	public static String DATEFIELD="FROM_DATE";
	public static String HTMLINPUT=ROOT+"HTMLInput//";
	public static String COMMANDOUTPUT=ROOT+"CommandOuput//";
	public static String DISPLAYTEXT_FILES =ROOT+"textfiles//";
    public static String TIMER_DIR =ROOT+"Logs//Logger//Timer//";
    
    public static void init()
    {
    	//path = "//home//wiki-ocean//obworkspace//FinalPOOL";
    	String path = System.getProperty("user.dir") + "//pool.properties";
    	//String path = "//home///ubuntu//workspace//PoolWeb//pool.properties";
    	Properties prop = new Properties();
    	try
    	{
    		System.out.println("Reading Properties");
    		prop.load(new FileInputStream(path));
    		System.out.println(prop);
    		DB_USERNAME = prop.getProperty("DB_USERNAME");
    		DB_PASSWORD = prop.getProperty("DB_PASSWORD");
    		DB_PREFIX = prop.getProperty("DB_PREFIX");
    		DB_NAME = prop.getProperty("DB_NAME");
    		DB_HOST = prop.getProperty("DB_HOST");
    		DB_DRIVER = prop.getProperty("DB_DRIVER");;

    		TYPE = prop.getProperty("TYPE");
    		ROOT = prop.getProperty("ROOT");
    		MASTERREPORTSPATH = ROOT + "//" + prop.getProperty("MASTERREPORTSPATH");
			TRASACTIONREPORTSPATH = ROOT + "//" + prop.getProperty("TRASACTIONREPORTSPATH");
			BASICREPORTSPATH = ROOT + "//" + prop.getProperty("BASICREPORTSPATH");
			BASICTRANSDETAILSREPORTPATH = ROOT + "//" + prop.getProperty("BASICTRANSDETAILSREPORTPATH");
			CUSTOMREPORTS = ROOT + "//" + prop.getProperty("CUSTOMREPORTS");
			PROCESSLOGGERPATH = ROOT + "//" + prop.getProperty("PROCESSLOGGERPATH");
			LogDir = ROOT + "//" + prop.getProperty("LogDir");
			STORAGEPATH = ROOT + "//" + prop.getProperty("STORAGEPATH");
			BILLREPORT= ROOT + "//" + prop.getProperty("BILLREPORT");
			SOBILLREPORT= ROOT + "//" + prop.getProperty("SOBILLREPORT");
			SENDMESSAGELOG = ROOT + "//" + prop.getProperty("SENDMESSAGELOG");
			SMSBUFFER = ROOT + "//" + prop.getProperty("SMSBUFFER");
			TDPRODETAILSREPORT = ROOT + "//" + prop.getProperty("TDPRODETAILSREPORT");
			GROUPREPORT=ROOT+prop.getProperty("GROUPREPORT");
			TRANSPDREPORT=ROOT+prop.getProperty("TRANSPDREPORT");
			SEPARATOR = prop.getProperty("SEPARATOR");;
			ENDSEPARATOR= prop.getProperty("ENDSEPARATOR");
	
			FILRFORMAT=prop.getProperty("FILRFORMAT");
			LOCATION = prop.getProperty("LOCATION");
			URL = prop.getProperty("URL");
			WEB_REPORTS_FILES = ROOT + "//" + prop.getProperty("WEB_REPORTS_FILES");
			DATEFIELD = prop.getProperty("DATEFIELD");
			HTMLINPUT = ROOT + "//" + prop.getProperty("HTMLINPUT");
			COMMANDOUTPUT = ROOT + "//" + prop.getProperty("COMMANDOUTPUT");
			DISPLAYTEXT_FILES = ROOT + "//" + prop.getProperty("DISPLAYTEXT_FILES");
			TIMER_DIR = ROOT + "//" +prop.getProperty("TIMER_DIR");
    	}
    	catch (Exception e) {
    		e.printStackTrace();
		}
    }
    public static void main(String[] args) {
		Input.init(); 
	}
}
